import Layout from '@/views/Layout.vue'
import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Article from '@/views/Article.vue'
import Collect from '@/views/Collect.vue'
import Like from '@/views/Like.vue'
import User from '@/views/User.vue'
import Detail from '@/views/Detail.vue'

Vue.use(VueRouter)

const router = new VueRouter({
  mode: 'history',
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/layout',
      component: Layout,
      children: [
        {
          path: '/layout/article',
          component: Article
        },
        {
          path: '/layout/collect',
          component: Collect
        },
        {
          path: '/layout/like',
          component: Like
        },
        {
          path: '/layout/user',
          component: User
        }
      ]
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/detail',
      component: Detail
    }
  ]
})

export default router